package com.example.neusoftfood_c17310120213_zhongyuanhong.model;

import android.view.View;

import com.example.neusoftfood_c17310120213_zhongyuanhong.activity.LoginActivity;
import com.example.neusoftfood_c17310120213_zhongyuanhong.activity.RegActivity;
import com.example.neusoftfood_c17310120213_zhongyuanhong.beans.UserInfo;
import com.example.neusoftfood_c17310120213_zhongyuanhong.common.Constants;
import com.example.neusoftfood_c17310120213_zhongyuanhong.listener.RetrofitListener;
import com.example.neusoftfood_c17310120213_zhongyuanhong.service.UserService;


import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class UserModel  extends RetrofitBaseModel {
    private UserService userService;


    public UserModel() {
        this.userService = retrofit.create(UserService.class);
    }
    public void userLogin(String username, String password, final LoginActivity listener)  {
        Call call=userService.login(username, password);
        bindCallback(call,listener, Constants.USERLOGIN);
    }
    public void register(String username, String userpass, String mobilenum,
                         String address, String comment, final RetrofitListener listener) {
        Call call = userService.register(username, userpass, mobilenum, address, comment);
        bindCallback(call,listener, Constants.USEREGISTER);
    }
}

